//
//  YZGeneralResultModel.m
//  YZStock
//
//  Created by fenchol on 15/8/27.
//  Copyright (c) 2015年 cqjr. All rights reserved.
//

#import "YZGeneralResultModel.h"
#import "MBProgressHUD+Utils.h"
#import "YZMControllerManager.h"

@implementation YZGeneralResultModel

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{
             @"code": @"code",
             @"success": @"success",
             @"resultMessage": @"resultMsg",
             @"data": @"data",
             
             };
}

- (void)showMessage
{
    [MBProgressHUD showMessage: self.resultMessage];
}

- (BOOL)checkNeedLogin
{
    return (self.code == 405);
}

- (BOOL)checkAndShowLogin;
{
    BOOL need = [self checkNeedLogin];
    
    if (need) {
        [YZMCMInstance pushViewControllerWithName: @"login" andParams: nil];
    }
    
    return need;
}

@end
